Using cURL with Spatial Studio REST APIs 您所在的位置:网站首页 libcurl header Using cURL with Spatial Studio REST APIs

Using cURL with Spatial Studio REST APIs

#Using cURL with Spatial Studio REST APIs| 来源: 网络整理| 查看: 265

cURL is a powerful command line tool available on many platforms for sending and receiving URL requests to a remote server.

When accessing or invoking a REST endpoint, the curl command follows a specific format.

For example, consider the following request to retrieve the Spatial Studio version:

HTTP GET Requestcurl -k https://localhost:4040/spatialstudio/oauth/v1/softwareVersion \ --header "Authorization: Bearer "

The options used in the preceding request are explained as follows:

-k: To indicate that the cURL request must accept the self-signed SSL certificate used by a Quick Start Spatial Studio instance. –-header: To set the Spatial Studio access token as a bearer token header in the request.

Note that the keywords Authorization: (including the colon and whitespace) and Bearer must be entered as is, with the entire value for the -- header option enclosed in double quotes. The variable represents the actual token string which must be provided in one unbroken line.

Note that the URL in the request uses oauth/v1 as path segments. If you accidentally use api/v1, then the response returns the web application login page in HTML.

The following sections explain with a few examples on how to invoke a REST API endpoint using cURL:



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有